package cn.iocoder.yudao.module.system.dal.mysql.student;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.student.StudentGradeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.student.vo.*;

/**
 * 学生班级 Mapper
 *
 * @author Sewen
 */
@Mapper
public interface StudentGradeMapper extends BaseMapperX<StudentGradeDO> {

    default PageResult<StudentGradeDO> selectPage(StudentGradePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudentGradeDO>()
                .eqIfPresent(StudentGradeDO::getStudentId, reqVO.getStudentId())
                .likeIfPresent(StudentGradeDO::getName, reqVO.getName())
                .eqIfPresent(StudentGradeDO::getTeacher, reqVO.getTeacher())
                .betweenIfPresent(StudentGradeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StudentGradeDO::getId));
    }

    StudentGradeDO selectByStudentId(Long studentId);

    void deleteByStudentId(Long studentId);

    void deleteByStudentIds(List<Long> studentIds);
}